home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
gfx
/
show
/
Bview_102.lha
/
Bview102
/
PicSrc
/
picture.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-12-03
|
2KB
|
87 lines
// Changed by Joeri Alberty to work with bview 0.99 and higher as example
// 03/09/93
// Shows you how to include C Source from IFF Picture in your own Source.
// The color table used in BASF.h is 4 bits/gun. These are TRIPLETS.
// You use here the function LoadRGB4().
// Set in Bview 'Save picture' 'Colors' on '4 bits per gun (CYCLE gadget).
// For AGA 32 bits/gun use LoadRGB32() (ULONG).
// Set in Bview 'Save picture' 'Colors' on '32 bits per gun (CYCLE gadget).
// Bview will make than a table for this function.
/*
This example is provided in electronic form by Commodore-Amiga, Inc. for
use with the "Amiga ROM Kernel Reference Manual: Libraries", 3rd Edition,
published by Addison-Wesley (ISBN 0-201-56774-1).
*/
#define INTUI_V36_NAMES_ONLY
#include <exec/types.h>
#include <intuition/intuition.h>
//#include <intuition/intuitionbase.h>
#include <graphics/displayinfo.h>
#include <graphics/gfxbase.h>
#include <stdio.h>
#include <clib/exec_protos.h>
#include <clib/alib_protos.h>
#include <clib/dos_protos.h>
#include <clib/intuition_protos.h>
#include <clib/graphics_protos.h>
#include <pragmas/graphics_pragmas.h>
#include <pragmas/intuition_pragmas.h>
/* My .h file made by Bview */
#include "BASF.h"
#ifdef LATTICE
int CXBRK(void) { return(0); } /* Disable Lattice CTRL/C handling */
int chkabort(void) { return(0); } /* really */
#endif
struct IntuitionBase *IntuitionBase = NULL;
struct GfxBase *GfxBase = NULL;
//UWORD pens[] = { ~0 };
VOID main(int argc, char *argv[])
{
struct Screen *scr;
struct Window *win;
if(IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",37))
{
if(GfxBase = (struct GfxBase *)OpenLibrary("graphics.library",37))
{
if (NULL != (scr = OpenScreenTags(NULL,
SA_DisplayID, ModeID,
SA_Depth, 4,
TAG_END)))
{
LoadRGB4(&scr->ViewPort,colortable,16);
if (NULL != (win = OpenWindowTags(NULL,
WA_RMBTrap, TRUE,
WA_CustomScreen, scr,
TAG_END)))
{
DrawImage(win->RPort,&Im_Pic,10,10);
Delay(500);
CloseWindow(win);
}
CloseScreen(scr);
}
CloseLibrary((struct Library *)GfxBase);
}
CloseLibrary((struct Library *)IntuitionBase);
}
}